package com.jiangmiao.babaisyou.domain;

import com.jiangmiao.babaisyou.util.GameUtil;
import com.jiangmiao.babaisyou.util.Location;

import java.awt.*;

/**
 * 规则块
 */
public class Text extends Block{
    private String rule;    // 即我们规则块的地址
    private Image image;    // 在初始化时，就完成图片的加载，【便于后续编码，当然为了效率，也可以在画图时在加载】大家后期可以尝试

    public Text(int x, int y, String rule) {
        super(x, y);
        this.rule = rule;
        image = GameUtil.loadBufferedImage(rule);
    }

    public Text(Location location, String rule) {
        super(location.getX() * 24, location.getY() * 24);
        this.rule = rule;
        image = GameUtil.loadBufferedImage(rule);
    }

    public String getRule() {
        return rule;
    }

    public void setRule(String rule) {
        this.rule = rule;
    }

    public Image getImage() {
        return image;
    }

    public void setImage(Image image) {
        this.image = image;
    }
}
